
function showDetail(id){
	$.ajax({
		url : "http://localhost:8888/simple_activiti/emp/emp_detail.do",
		dataType : "json",
		type : "post",
		data : "id=" + id,
		success : function(result) {
			if (result.hasError) {
				window.wxc.xcConfirm(data[0].errorMsg,
						window.wxc.xcConfirm.typeEnum.error);
			} else {
				$("#id").text(result.data[0].id);
				$("#email").text(result.data[0].email);
				$("#role").text(result.data[0].role);
				$("#manager_id").text(result.data[0].managerId);
				$("#sex").text(result.data[0].sex);
				$("#idcard").text(result.data[0].idcard);
				$("#salary").text(result.data[0].salary);
				$("#work_desc").text(result.data[0].workDesc);
				$("#empDetailModal").modal('show');
			}
		},
		error : function(data) {
			var text =$.i18n.prop("emp_request_fail");
			window.wxc.xcConfirm(text, window.wxc.xcConfirm.typeEnum.error);
		}
	});
}

function deleteEmp(id) {
	var txt = $.i18n.prop("emp_oper_del_confirm");
	window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.warning, {
		onOk : function() {
			$.ajax({
				url : "http://localhost:8888/simple_activiti/emp/delete_emp.do",
				dataType : "text",
				data : "id=" + id,
				success : function() {
					var txt = $.i18n.prop("emp_del_success");
					window.wxc.xcConfirm(txt,
							window.wxc.xcConfirm.typeEnum.success, {
								onOk : function() {
									window.location.href="http://localhost:8888/simple_activiti/emp/emp_list_for_page.do";
								}
							});
				},
				error : function() {
					var txt =$.i18n.prop("emp_del_failure");
					window.wxc.xcConfirm(txt,
							window.wxc.xcConfirm.typeEnum.error);
				}
			});
		}
	});
}
